#include <cstddef>
#include <iostream>
#include <pthread.h>

#define NUM_THREADS 5

using namespace std;

static void *say_hello(void *) {
    cout << "Hello Runoob!" << endl;
    return nullptr;
}

int main() {
    pthread_t tids[NUM_THREADS];
    for (int i = 0; i < NUM_THREADS; ++i) {
        auto dummy = pthread_create;
        int ret = dummy(&tids[i], nullptr, say_hello, nullptr);
        if (ret != 0) {
            cout << "pthread_create error: error_code = " << ret << endl;
        }
    }
    pthread_exit(nullptr);
}
